<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableCityPrice extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('city_residence_price', function (Blueprint $table) {
            $table->id();


            $table->bigInteger("bkId")->default(0)->comment("小区id");
            $table->longText("border")->nullable(true)->comment("边界")->default("");
            $table->string("name")->comment("小区名称")->default("");
            $table->string("centerLongitude")->comment("经度")->default("");
            $table->string("centerLatitude")->comment("纬度")->default("");
            $table->bigInteger("price")->comment("价格")->default(0);

            $table->string("provinceAdcode", 6)->comment("省份adcode")->default("");
            $table->string("cityAdcode", 6)->comment("市级adcode")->default("");
            $table->string("districtAdcode", 6)->comment("区域adcode")->default("");
            $table->string("addressPrefix")->comment("城市前缀")->default("");
            $table->bigInteger("bizCircleId")->comment("商圈id")->default(0);

            $table->unsignedTinyInteger("runStatus")->comment("执行状态")->default(0);


            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->unique(["bkId"], 'idx_bkId');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '城市小区价格';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('city_residence_price');
    }
}
